package com.example.demo.Controller;

import com.example.demo.Controller.Pojo.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class UserController {
    @RequestMapping("hello")
    public String hello(){
        return "hello,word";
    }
    @RequestMapping("add")
    public List<User> add(){
        User user = new User();
        ArrayList<User> users = new ArrayList<>();
        user.setAge(18);
        user.setName("张三");
        users.add(user);
        return users;
    }

}
